package com.xu.hutool;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.extra.tokenizer.Result;
import cn.hutool.extra.tokenizer.TokenizerUtil;
import cn.hutool.extra.tokenizer.Word;

/**
 * 记号赋予器引擎
 *
 * @author Tom
 * @date 2021/08/24
 */
public class TokenizerEngine {
    public static void main(String[] args) {
        cn.hutool.extra.tokenizer.TokenizerEngine engine = TokenizerUtil.createEngine();

        // 解析文本
        String text = "这两个方法的区别在于返回值";
        Result result = engine.parse(text);
        String resultStr = CollUtil.join((Iterable<Word>) result, " ");
        System.out.println(resultStr);

        }
    }

